package com.fpost.util;

import java.io.UnsupportedEncodingException;

public class UnicodeConverter {
	
	public static String convertToUnicode(String str) throws UnsupportedEncodingException {
//		In the Servlet 2.2 API, the methods that parse parameter input always assume that 
//		it is sent as ISO 8859-1 (i.e. getParameter() et al). 
//		so they create a String containing the correct bytes but incorrect charset. 
//		If you know what the charset is, you can convert the bytes to a string 
//		using the correct charset: 
//		new String(value.getBytes("8859_1"), "utf-8") 
//		8859-1 is the default encoding of HTTP.
		
		str = new String(str.getBytes("8859_1"), "UTF-8");
		return str;
		
	}
	
	public static String convertFromUnicode(String str) {
		return str;
	}
}
